<template>
  <div class="page-tools">
    <div class="left">
      <el-button v-if="btnAddShow" size="mini" type="primary" style="margin-right: 10px;" @click="$emit('addBtn')">新增</el-button>
      <template>
        <el-popconfirm
          confirm-button-text="是"
          cancel-button-text="否"
          title="是否要删除批量删除选中？"
          @confirm="$emit('deleteBtn')"
        >
          <el-button v-if="btnCloseShow" slot="reference" size="mini" type="danger">批量删除</el-button>
        </el-popconfirm>
      </template>

    </div>
    <div class="right">
      <el-tooltip class="item" effect="dark" content="点击刷新" placement="top" @click.native="$emit('resetBtn')">
        <el-button class="refresh"><el-icon class="el-icon-refresh" /></el-button>
      </el-tooltip>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PageTools',
  props: {
    btnAddShow: {
      type: Boolean,
      default: true
    },
    btnCloseShow: {
      type: Boolean,
      default: false
    }
  }
}
</script>
<style lang="scss" scoped>
.page-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;

  ::v-deep .el-card__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .refresh {
    border: none;
    background: none;

  }
}
</style>
